
<template>
  <div>
    御剑乘风来,除魔天地间!===vue3==={{ num }}===
    <button @click="handle">按钮</button>
  </div>
</template>
<script>
import { ref } from 'vue'
export default {
  name: '',
  setup () {
    /* 
  ref:
  + 可以定义简单和复杂数据类型
  + setup中获取值需要.value
  + 模板上使用不需要.value
    */
    let num = ref(10)

    const handle = () => {
      // console.log(num.value);
      num.value += 10
    }
    return { num, handle }
  }
}
</script>
<style lang='less'  scoped>
</style>